Implemented: Module J. Task 1, task 2 and task 4