FIX: transition matrix was being computed incorrectly.