updated as per hw4