Got requires worked out, and fixed SQL stuff to use AR