Almost complete simulator implementation + calculus corrections