added some avoid obstacle stuff