Commiting to test progress - refractored alot of code