adding final piece of functionality