Data Structures implementation in Ruby