an exception handler for ranges

some more fixes

some cleanup and LREFs

some redoing

some more

some more testing