added custom xp input, improved code