cleaned up slightly, more data encapsulation