added factorial and improved documentation a bit