added small functions to process individual files