added hw4 and hw5 code