Assignment 2, required task 3 done.

I think it's done, haven't tested enough.