make changes to first half of lecture 21