this is from birdsun's first commit.