code from the second half of the semester