Working code for session3