JSNSR04T V2 unstable values

Im using JSNSR04T version 2

I can accept that you know what that means. I haven't a clue.

can any one suggest edit on my code for reducing spikes and jumps?

Average the readings. Keep track of the previous reading. Ignore any that are radically different. Post ALL of your code. Pick any two.