better (and not yet complete) handling of obstacles