added code to sim1