added more documentation, and fixed small typo