Display function, breaking up SQL