Initial recommit, refactored some code and begin implementation