made changes to stage 3; stuck inside an infinite while loop bc value doesn't ever update and is always zero