Completed task 2 in procedural way.