finished algo hw4