moved toggleSolution function out of update() function