lots of syntax fixes