add stuff for scoscandir, change indexing in sampmap a little.