add getStat function, which display some statistics