fixing bugs such as the indices on the probability table