fixes #1, fixes #4, fixes #11