Actually compiled code this time, fixed unclosed comment and variable not existing in while loop