reconstructed code to use multiple files