2. Change the above code so that it works as stated in previous question.