same stage as last time but using a vector to store all objects