working ruby soln