Mod: Implement solution() function and modified clearBoard fution. Also code clean up and add more comments.