add isSolved function