Quick and dirty modification to use id in place of host. More surgery is required to make this clean.