remodeling

moving the code into resultsetToArray function