Implemented phi analysis