Linear interpolation using 2D lookup table

Thank you for your input, I can specify the length of the table in the for loop since its size does not change. It works properly now.

Cheers
Sid