Added implementation of Task 1.