Began to write simulate function