modified main and gui