fixed bugs, added centering