Sample algorithm written, simulator developed further.