added simulation logic