hallidayResnick-2-3: Added dymanic sizing of canvas