added variables x and y
changed variable x
Capitalization
Reversed the Z variable
Minor changes
moved block to a variable and used as parameter for ERB.new