function ref wip