add fast remapping function, fix unclosed files bug
increase window size, don't try to match templates at border