coffeescript variable matrix. Calculate a 'preferred' square matrix if possible by the given item elements