finished hw3, hw4 and hw5