Restored sonar functionality, cleaned up comments