added plot1.py algorithm