Tried to merge code