much simpler implementation of primitives completed