changed prob array to double to reduce amount of type-cast for speed-up purposes