code incorporated all asked changes