p54. TODO: make tree? fn's parameter look cleaner by introducing aux fn