TODO: Implement somekind of cache flush or we'll runout of memory