updated method to take parameters.