Starting to write tests
Put in more tests and refactored to return array instead of modify in-place