fixed bugs in solution