Text this: A modified pseudospectral method for solving trajectory optimization problems with singular arc