Added comments and probability calculations