Simple implementations of a couple of primitives