fixed some bad syntax, and touched up if statements to avoid errors