Implemented second task.