added tabulating version and fixed a bug