I'm not too happy with the functions in revise.go. They could definitely use some refactoring...later.
revise.go