changed cost functionality