use list literal for speed
use a Tree instead of linear search
use actual number of bins, when folding