Finished version for Assignment 4