The last patch did not compile as there was no size member in scope. Therefore this patch resorts to using the size of the vector.