Cleaned up heap.js