Changed structure of the program, now infers semantics