modified example so that it works