assignment 3 code