Fixed the heap and formatted all