Functional Programming Homework