copy of http://sourceforge.net/projects/samchaned/