Arguments parsing modified to handle missing last argument error, print statements added