refactored for loop and therefor changed the assignment of default values for the options object