computing theta and fixing bug with eta