Added main and filenamefunction