Updated semantics, made it type-check