adding ruby implementation