more progress on functional programming