Could you just go to the box's style to calculate the position? That would save memory.