Rewrote stop functions to work off PIDs in order to be more portable