Homework Functional programing