How the law can do justice to emerging technologies