LOTS of code has been rearranged or added.