solved solution for best.R ill try to refactor it later, but seemed to pass all tests so its good to go