more vectorization work, fixed #items sorting

#items sorting solved by promoting to a (wider) signed type. See
item.cpp