Filling out helper functions and tests (currently failing test)