initialization of variables corrected