debugged -lphi and -rphi