Updated to work properly with the for loop. Still to be updated:

Signed-off-by: edge226 <lucid@celps.org>