original patch by gilbert