Modify centering functions to take an optional parent (in which to
center)