fixes #12. fixes #10, fixes #1, fixes #11