Made modifications as per #2