quick and dirty code for ruby warrior.