initializing memory and other weird shit