140118241:fix all bugs

and add some statistics.