Removed some extra print statements; no major change in the code