added algo2.py