Creating SRT sorting and looping