Implemented new reduction rules, fixed pretty printing bug