fixes #5, fixes #3