Made the example more general