A third implementation, with multiple functions