made toString method emulate case class implementation