right job algorithm implementing