Implemented encoding/comparison for updated Material implementation