Added collision detection to parallel.py

-Also cleaned up a lot of code (better notation, etc.)
-(Also made some code messier, repetitive.)