made conditions in compute_infix_string nicer