move days_left_in_trial to python, other works in progress