updated documentation, fixed error when looping over files