more progress on heap patterns