Increase performance by emove usage of 'filter' function in calculations (http://jsperf.com/filter-and-loop)