added factorial evaluation, moved semantics to the front