GUI and algorithm working puuuurfectly