add pattern table in front of result