Finished the helper functions