ordering code

minor changes ordering code