Merging Ankit's code....Try 1