make it work with multiple files