fixes #1 and adds documentation