modified interval logic