Modified unwrap phases calculation method, removed unused variables