Two lessons in functional programming for CS470 Artificial Intelligence