Final version of assignment 3