Function for centering data.