script for converting IDS to ascending