adding more interval simulation code