changed boundingrect to offset for performance