changed structures to classes