Modified XTicks, improved code