a little cleanup and add a new parameter