finished v580pat_expand.py