modified as per given question