Completed Simulation Algorithm

MATLAB code complete and commented