Need help with LDR controlling LED

Hi, I'm very new to programming and arduino. i am trying to make a led turn on when the LDR is covered(dark) and off when uncovered. I am using a potentiometer to control the threshold but the led flicker's when very close to this theshold. I've been googling and there is something called hysteresis to stop this but there is no explaination of what this is anywhere.

any help would be appreciated.

p.s. i think i posted in the wrong section before( hardware troubleshooting) so ill post it again.


See my reply in the hardware section, and quit moving around ;D