Working commit, much restructuring