added window.capability and add(obj, xPos, yPos)