Changes to make it more object oriented

Working to make it more object oriented. Still a long way to go.