Task 3 completion after adding heap for sorted access