Made all the changes into one commit that could be a patch for master