Included the code changes 

I will make major modifications to soon.