Code works with Ruby1.8