fixing up helper functions