added lots of functionality