reshape function and fix for corpus.append