Removed merge errors and reverted to new code