Changed distribution algorithm a bit
Added longest-wait-first scheduling (only with useSharing on)