I improved it a little bit. How to do what I did: If (experience cost)<xp or (experience cost)=xp then change xp by (experience cost) change power by (power increase) else (nothing)