Added a function to check whether an interval is empty.