fixed some syntax and var name errors