merged the ulfalizer's lastest code