Switched to using assertions.
Added comments
Reverted back to C.

C++ was too much of a headache.
Reduced space requirements.

Moved patterns down 1 element.
Logm delay implemented in C.