a heap version of hw5