added center method and toString returns undef when it is not valid