added option to work with negative time intervals