add a method for task 2