added filepath as input argument