add distribution pattern pareparing code