Changing code of OS X wall paper changer to methods