reverting to previous processing.py where the ended logic wasn't included. will start new branch.