Changes to code and added documentation. Working commit