trying to implement the save array function