normalize P so that all rows sum to 1