use array to track frequency of items ordered by item_id as index