Few changes in code to make things right. Removed garbage code