incorporated suggestions for Interval comparison from konstantint