completed task4 functionalities