A modified genetic algorithm for optimal control problems