added random.
fixed bug with calls to isOp (hopefully)
jshint fixes