According to BSD license, add some modifications