Edited to reset decision variable after each iteration of a loop.