abandoned array approach