Some code refactoring. Added binary heap implementation.