Implement best fit assignment