merged sql functions into one file; adding posts works