Compatible with Vishy's implementation