Revert "stop using .First; use local. modified some functions"

This reverts commit d8a3a4aad45d245830ee33fa2dc6e047922e2150.
Revert "Revert "stop using .First; use local. modified some functions""

This reverts commit d39c7b4947b06914ebc9edd57705eb685683de52.