Changed private member variables to locals