Replace inefficient query and fixed insert.
Added chevron-up and chevron-down icons.