finished building heap, tested naive algorithm