address review comments: add brackets to ifs
address review comments: initialize member variable