Modified solution to include peg moves