completely refactored everything; now in a good place with code layout;