more realistic example, changed function types a bit