Working commit

Almost final code