added better string representation to match scala's version