modified tune function to accept param ranges as argument