Rewrote gen_pseudo to fix the condition propagation bug!