something of a class structure. Needs some work.