Added parameters and file handling