Added interval selection and error checking.