added REPO parameter; improved usage; make some parameters optional