Added proper comments in code