rewrote anonfun syntax