added grunt and grunt uglify
changed for loops for optimization