updated class code for session4
solved merge conflict