Updated code with merge conflicts removed