Fixed wilks, tightened code