fixed r squared calculation