Updated code for four sonars.