functional programming assignment II