Backed out optimized fitness code for master branch.
Optimized code is on separate branch (fitness_optimal_code).