implementation of simulate method