first draft dynamic host sample, needs some cleanup and extra doco though