Updated Michael's patch