There is no way to solve your problem unless we know the logic behind that method.