Fixed long line and indentations. Used hasClass.