Basic outline (very inefficient)