add support for reverse order