adapted to OOOR 2.x API; seems to mostly work so far