Added few more functionalities and indented the code