played with cell width and fixed if-else logic