todo: need to finish and optimize
functional programming examples from Mary's workshop