added sonar, fixed lots of errors