added basic when/then parsing