fixes #2 - also some work on #1