add 2 new functions for cost files processing