original patch

coded by yoshitaka Oishi