a simplified version of the example