Removed the array from the code to reduce the memory footprint.