need to debug why while loop is not same as the commented code