changing back the working array gen code