Implemented task to lab3.