fixed xwidth calculation