refactor and added mutation to the breed function