replace use of HEAP

also, fix a bug in how votes are registered