How to optimize non-sequential optical systems