Necessary but messy/unorganized changes to suit INL needs; needs refactoring.