Add function for calculating objective function scores