Working commit, debugging left is as work in progress