added a lot of functionality