Added more error checking and more control over start/stop