replace use of $$ by \[\]