debug assemble.pl and refine scripts