implemented getObstacles