higher order funcs added to list scala