rough implementation of FourHeap, semi untested