Improving memory usage

detectvid still uses lot of memory :(