working code to read webcam