Added some more documentation on functions