add warning and error prints
reinitialize vars to zero