Assignment 3 and bug fixes