fix typo
add some error handling
Improve error handling
whitespace
fix test
now uses Patch
refactor to do ranges