A bit better and this time in ruby