fixes #2 and closes #4