Changed theta to phi in appropriate places