change simulation code for SS and add prior simulation code