A little modified version of Scanlim/Micah's patch