Passed all the tests for 13

Could probably be refactored to something cleaner but it passes all the
specs