completed new version of co-in.py