added time and constructing frequency tables