improve code for finding max
normalize values for transition matrix