On the sandpile group of a graph