some refactoring + 2 files for max heaps