experimenting with functional programming techniques