generalising example, and making the type checker work