Code to check for root privilege has been added and tested.