accept most changes from yjw-libs