Modified for control inputs and removed send thread