added centering code