Added generics to heaps