implement xp functions