Finalized bash program to run the code