remove declarations from loops

Declaring a variable inside a loop means each time through the
loop, the variable is declared. Remove and things should speed up
in the loop: no need to remove and redeclare the variable each
time.
Merge branch 'Development' of https://github.com/emmamei/cdkey into Development