working secondary sort feature