First part of fitness function done and tested