added a whole lot of functionality