works on #7. integrating pre-fragment code