Changed the code and used interpolation