added time interval class and wrote test