reworked interval class