Refined simultaneous coding.
Added simultaneous option.
Needs more code cleanup.