adjust memory positions