Added r-squared and additional unittests