added running and gui function