Restructured and made basic sonar program