add better ordering, and a few indexes

nothing major, ready for deployement