exposed the predicate to generalise the funtion