Added HW6 bug fixes