fixes #3 and fixes #4