Quite a bit of functionality added, but needs a MAJOR cleanup
Bit of a cleanup