Optimal Controls for Systems with Time Lag