use size_t and time_t
fix bug
bug fix and refine
refactor