Modified program structure to avoid channels for performance reasons.