simplified grid type logic, added flex specific ordering classes