revised staging.rb