table code simplified, thanks Js41637!