made the helper functions easier to debug (can be called on their own)