added equilateral encoding functionality