enhanced gui and algorythm to make it faster