added the rest of functionality