Update fragments.py

I wrote some things you might want to check
Merge pull request #1 from euricaeris/patch-1

Steal some ideas from @euricaeris.