Chaged the end pattern to detect code chnuks and added generic doc chunk pattern