added a bunch of functionality