add methods to convert to text and back