Added a new function for sabermetrics problem set