slight fix to costreduction code