modified tuning
added trycatch; added randomization