Extra tasks 1 and 2 implemented. Task 3 partially implemented.