Added the alignToPixel code