add comments to reverse.cpp