Working GUI and Algorithm