modified inputsub.rb