Removed unused cost function