Written code for functions and added descriptions