How to use "function" in a sentence

Sentences

He must be totally secure in his estimation of his talents if he is to function well in the kitchen."

His ships, sealed in their glass worlds, relaxed him; he liked to spend time with them when he had a problem to work out or when he was on edge, for they made him feel serene, and that security allowed his mind to function at peak performance.