working on semi/finals, fixed sorting algorithm
added sorting
working flow