added the code for the second class