Ignore DS_Store, add some error checking and comments