Revert "Revert "Add method center()""

This reverts commit f1c3daae4bb616137044fc22962c51f81e4b874b.