Multi-level indexing for arrays and hashes

Please review if this approach is right.