fixed lots of syntax/semantic errors