rename types to bins, add indexing, add filetype detecting.