update simulation code to align with changes in the function arguments