working on simulate