removed center attribute and replaced it by a method