made the parameters dynamic