reduced multi dimension array to a single dimension, improved variable names