Re-ordered some columns, tidied up SQL