Wrote simulation logic and statistics capture