add method to compare and to convert to string