Changed to accept arguments from commandline