move calculatePercentage out of the puzzleController