add examples to getOptTheta funciton