Code working as of end of lecture #3.