done pre-calculate coord