Thanks for the link , it was really useful. I made the appropriate changes but the code still won't work. I can't seem to understand how to debug it anymore. Any pointers on how to approach this . As in the approach i should take to debug it. I even went through the adafruit library