added rest of functionality