fixes #4 and fixes #3