Added memory segment managemant