improve documentation layout
IMPORTANT: we should not modify the attributes of self, because it will change the results if we call it multiple times, we need to check it everywhere