uses Array#[] instead of when/case