Initial template matching