minor changes to phase retrieval