working mult table soln in rb