refactored x y : cols rows. not so painful, with a test rig