Refactoring

Refactoring of the for loop to be a bit nicer. Therefor I had to change the assignment of the default values for the options object and summarized the first couple of var statements into one.