All tests pass
Refactored to make it shorter