added support for different obstacles