replaced the cost_type_str with a simpler Cost_function enumeration for passing around to lots of places
forgot to save this file before last commit, done with requested changes, but need to check for compile errors not ready yet!!