added validator.
TODO: exit application when puzzle is solved