move away from the array approach