written by sgr-ksmt