finalized fitness calc and fixed some minor bugs