Pushed changes from the master version round 1
Pushed changes from the master version, phase 2, updated copyright
Polished off some of the bugs while merging with new code from master branch