StoreZ function

This function helps store z from all iterations after burn in