added getter, toString, and compareTo