Isolated simulation into a subroutine