Merge branches 'version2' and 'temppp' into version2
Fix logic for object avoidance