removed temp arrays