completed revesion of assignment 5