Extended functions and added basic documentation.