implemented history::length