Practising higher order functions