submitted patch from Steve Gare