1. created the framework for the best.r function