reordering stuff to make the test sql script actually useable.