updated for python2, and sort column changed