Update main.py

Phase-retrieval function updated.