copied from example.