function to fill up memory is complete