added inline comments, now terminates last stopped instance