fixed testing method by changing temp array to empty temp array