removed all the class stuff, it was overkill. refactored down to functions