initial fixes, wrote features
features added after Tom/Mihai meeting