Change in main except the change in algorithm