Added simple sim and some C code for the old sim