final changes from the train, ages ago - and a fix for mongoose ordering