rewrite of chapter on semantics