Fix Grid Generation, add Automatic columns and rows count