malloc to replace bestmatch 'dynamic' array