format solution in lua