Pahaly updated code with first and second task