better document ids from filename
also added test case i left out in last commit