using scale instead of for loop for centering