added explicit global variables zeroing