fixes #6 and fixes #1