update functional programming