Added interval function