assignment 2 source code