added classes and (part of) set up for relationship