heap-based exp