added some code for second assignment