Corrected fragment generation

Much simpler than I expected. After a fragment is processed, it is
discarded immediately. No extra messy loops!