What is the function of the prefrontal cortex?

Generates eye movements
Produces movements for speech
Coordinates skeletal muscle movements
Coordinates intellectual and personality-based functions, including planning and judgement

The function of the prefrontal cortex is to coordinate intellectual and personality-based functions, including planning and judgment.