added emergency stop to pid... needs testing
commiting the local changes that were made to the sub while testing