fixed #16 - coordinates were relative to the screen rather than window