fix #1 and fixes #2 and closes #3.