orignal source written by songtzu, which contains lots of bugs