1024: put i*7+j in a var, replace i>=0 with ~i, repeat function params, enhanced ui