fixes alignment code