using toString, adding extends, properly handling null values