Working except tempvar assignment in while-do. (assignment not done)