Added external memory support.