move most of the code from script.py to prossc.py