Fixing bugs in heapsort algorithm
Renaming inner functions (inside methods)