replacealluseswith function to the rescue - does bulk of the remaining work