almost done with helper functions