added popup dim pos calculations