making code cleaner and generalization on position of CELL && CELLR