change variable name and change search paidup algorithm