fix .DS_Store and consolidate training computation
add tests