Deleted some redundint code
fixed merge conflicts