Added proper documentations for all the functions and removed unwanted codes