Up debugging and add doc string