implementing sonar script