trying to maximize the t_cd