functions to be used with pvp