Implemented a sort method for the cells order