Function setupPosition