finished hw5 solutions