got close to finishing assignment 1, but there is a bug.