created our own encoding to ensure equality between encodings