refactor, moving paragraph oriented functions to new paragraph.c