Some small bug fixes

Using a generated loop wasn't really good and by thinking a bit more...
why should a user write a line in the opposite way... it makes no sense
for me... so i just replaced the long fors with a small and good looking
for...