Added some sudo code for most of the process. Should easily be replaced.