helper functions + comments