Making clampPos a local function is an option.