accept details from the user and write to file