Updated code to accept filepath to settings