refactored functions
removed prints
dunno what changed