calculate and set params