bug fixes to assignment 3.