weighted sorting and threads in gui