set up the basic logic for executing tasks on the hosts