Also, this whole section could be abstracted into a for loop over the different profiles that we try.  Then at line 56 we could just print the variable with the ones we tried.  This would make it lots easier to add new profiles to try! :)