changed how we determine mid pixel