Update and rename die.rb to lib/die.rb

* simplified code