Implement shape of tableau and fix a bug