reorganized the loop to include page
removed unneeded code
refactor
corrected closing comment
moved post functions into one file
added more information