Update best.R

Appended with test code.