added new script and fix compile bugs