fight function variable change

changed variables from function() to object variables