Added thom's patches