#4 solve extra memory problem