adjust memory and output