Added unloading and fixed up loading