fixes #2, fixes #3, fixes #4