Updated to new API with command line args support