two helper functions
two helper functions