Funnel problem from CS 281