updating with arrays (for better memory performance)