finished adding sudo code in main method