hallidayResnick-2-3 Bug fixes, code cleanup