Adding method to merge digits