added the completed first portion of assignment 3 which is best.r and the start of the second portion