Implemented tasks 3 and 6