obtain gate id as an argument to main and fix some prints