Finished R2

Contains all code for R2, some commenting still left to do and some
other cleanup but, its all done