Final Lab 4 Code.

Refer to Lab 4 PDF for more details.