added BGGraphics-Gavin patch