implemented new if/else/end system (mostly complete)