Core Algorithm Files

Changes to p2.py, p3.py