Check answer works.

The only thing left are all the test cases.