implement replace and setPriority methods