finalized homework 3