Final GUI code