Updated Merged code