added test cases and cleaned up some mistakes with using the R tuning parameter