made new functions, easier for testing