verbatim patch from tadgy