Updated cost functions