closes #60 + minor bugfixes