update algorithms
add heap implementation