This is the code for the second part