changed centering method