fixed math with instance variables, syntax fixes