Added documenation for all the functions.