Bug fix, was allocating way too much memory