closes #5 and fixes #6