stop using .First; use local. modified some functions