Removed underscore each loops to speed up the performance
Added a bit of documentation