finalize lecture 4