Machine output

fixed the loop bug (non-kludge version)
the above logic changes weren't really to fix the bug, it was to make it a little harder to trigger the regeneration when it isn't really necessary.