merged Jake's fix for order changes