added particle counting and demo in demo_plain.py