Position calulation logic change while removing padding dependency