adding functions to calculate self information of tokens