Fix algorithm integration with main.py