fixes #3, some cleanup