Update to start working with both arrays and dictionaries