extended mem code size and shrink stack