Finished problems 3 and 4 from lab2.
Finished version