calculating position. Purposefully not using drag n drop library