centering x correctly using the calculated bounds. Y isn't working though
finally centering on y with rhys' help