fixes #5 and fixes #4