bug fixes for HW3