translate from particle.py to main.py