pattern completion