Simplified implementation of latin-square?