Made example more generalized