Fixing bug

Pushing working version without some of the just implemented features
(has bug somewhere) so that Erwin can look at it and have it work if he
wants :)