Started writing functions to make tests pass