Implemented the toString() method.