added code for session3 with comments