Added better memory support